#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int main() {
    int n = 0;
    scanf("%d", &n);
    char arr1[17] = { 0 };
    sprintf(arr1, "%d", n);
    int len = strlen(arr1);
    int count = 0;
    for (int i = len - 1; i >= 0; i--)
    {
        count++;
        if (count % 3 == 0)
        {
            for (int c = len - 1; c >= i; c--)
            {
                arr1[c + 1] = arr1[c];
            }
            arr1[i] = ',';
            len++;
        }
    }
    if (arr1[0] != ',')
        printf("%s", arr1);
    else
        printf("%s", arr1 + 1);
    return 0;
}